<?php
class purview{
	public function init($params=array()){
		$this->db=$this->yum->library($this->yum->vars('app','database'));
		$this->prefix=$this->yum->vars('app','prefix');
	}
    function GPurview($params){
    	$purview=array();
    	$temp=$this->db->select($this->prefix.'purview',$params);
    	if(!empty($temp)){
			foreach($temp as $key => $value){
				$purview[$value['controller']][$value['method']]='';
			}
    	}
    	return $purview;
    }
    function IPurview($params){
		return $this->db->insert($this->prefix.'purview',$params);
	}
	function DPurview($params){
		return $this->db->delete($this->prefix.'purview',$params);
	}
    function RPurview($params){
		return $this->db->replace($this->prefix.'purview',$params);
	}
}
?>